package cn.tedu.charging.user.controller;


import cn.tedu.charging.user.pojp.vo.UserInfoVO;
import cn.tedu.charging.user.service.UserService;
import cn.tedu.charging.common.JsonResult;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: Miyako
 * @Date: 2024-10-14-10:16
 * @Description:
 */
@Slf4j
@Api("用户模块")
@RestController
@RequestMapping("user")
public class UserController {

    @Autowired
    UserService userService;
    @GetMapping("info/{userId}")
    public JsonResult<Object> userInfo(@PathVariable Integer userId){
        log.debug("收到{}",userId);
         UserInfoVO userInfoVO = userService.userInfo(userId);
        JsonResult ok = JsonResult.ok(userInfoVO, "success");
        log.debug("返回{},{}", userInfoVO,ok);
        return ok;
    }

}
